<div class="row"> <h3 class="page-header">仪器库管理</h3></div>
<div class="row">
    <div class="panel panel-default">
        <div class="panel-body">
         <label><a class="btn btn-primary" href="{:U('Yqk/add')}">添加</a></label>
            <form action='{:U("Yqk/index")}' class="form-inline text-right fr m-b-5">
                名称：<input type="text" name='name' value='{$Think.get.name}' class="form-control mr20 w150">
                <button class="btn btn-primary" type="submit">搜索</button>
            </form>
            <div class="table-responsive">
                <table class="table table-striped table-bordered table-hover">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>设备名称</th>
                        <th>设备编号</th>
                        <th>单位</th>
                        <th>借出时间</th>
                        <th>归还时间</th>
                        <th>状态</th>
                    </tr>
                    </thead>
                    <tbody>
                   <empty name="list">
                         <tr><td colspan="7" align="center">暂无信息</td></tr>
                     </empty>
                    <volist name="list" id="list">
                        <tr>
                            <td>{$i}</td>
                            <td>{$list.name}</td>
                            <td>{$list.number}</td>
                            <td>{$list.unit}</td>
                            <td> 
                            <empty name="list.jctime">
                                    —
                            <else/>
                            {$list.jctime|date="Y-m-d H:i", ###}
                            </empty>
                           </td>
                            <td>
                             <empty name="list.ghtime">
                                    —
                            <else/>
                            {$list.ghtime|date="Y-m-d H:i", ###}
                            </empty>
                           </td>
                            <td> 
                            <eq name="list.status" value="1">
                              <a class="btn-sm btn btn-primary" href='{:U("Yqk/sy?id=".$list["id"])}'>使用</a>
                            </eq>
                             <eq name="list.status" value="2">
                              <button data-url='{:U("Yqk/gh?id=".$list["id"])}' class=" btn-sm btn btn-primary GhBtn" type="button">归还</button>
                            </eq>
                            </td>
                        </tr>
                    </volist>
                    </tbody>
                </table>
            </div>
            {$page}
        </div>
    </div>
</div>
<script type="text/javascript">
$('.print').click(function(){
    var obj = $('.print_item:checked');
    if(obj.length > 5){
        alert('每页A4纸只能打印5个产品哦');
    }else if(obj.length > 0){
        var ids = 0;
        obj.each(function(i, v){
            ids += ',' + $(v).val();
        });
        window.open('{:U("Product/prints")}?ids=' + ids);
    }else{
        alert('请选择打印项');
    }
});
</script>